﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FastData;
using FastCtr;
using Microsoft.Win32;
using System.Windows.Forms;
using System.ComponentModel;

namespace InjectMachine
{
    public class InjectANDWeigh : ANDweigh
    {
        string _title = "";
        //static object SoftwareKey = Registry.CurrentUser.OpenSubKey("SOFTWARE", true).OpenSubKey("FastCtr", true).OpenSubKey("AndWeigh", true).GetValue("WindowState");
        public InjectANDWeigh() : base()
        {

        }

        [Localizable(true)]
        [Browsable(true)]
        [EditorBrowsable(EditorBrowsableState.Always)]
        public string Title
        {
            get
            {
                _title = Site.Name;
                label1.Text = $"AND称重器({_title})";
                return _title;
            }
            set
            {
                _title = value;
                label1.Text = $"AND称重器({_title})";
                if (!FastData.DesignHelper.IsDesignMode)
                {
                    ANDserial = new NewSerialPort(_title);
                }
            }
        }
    }
}
